package 设计原则和思想.面向对象和面向过程的对比.java;

import java.util.ArrayList;
import java.util.List;

public class UserFileFormatter {
    public void format(String userFile, String formattedUserFile) {

        // Open files...
        List users = new ArrayList<>();
        User user = User.parseFrom(userFile);
        users.add(user);

        // sort users by age...
        for (int i = 0; i < users.size(); ++i) {
            String formattedUserText = User.formatToText();
            // write to new file...
        }
        // close files...
    }
}